All Questions
44 questions
8votes
3answers
2kviews
Is set of integers closed under the operation of subtraction?
I was working on a problem, but my solution did not pass the time limit test. Problem Let's say a set of integers is closed under the operation of subtraction if for two distinct elements of this set ...
8votes
3answers
2kviews
Sieve of Eratosthenes in C++ with wheel factorization
I have written a completely working C++ program for the first time, and I have managed to compile it. I have decided to learn C++ and I have written a C++ program to familiarize myself with C++, this ...
1vote
0answers
80views
S_n covariance calculation function
I am trying to understand the estimator proposed in ["Multidimensional outlier detection and robust estimation using Sn covariance"][1]. I wrote the code in a basic line-by-line form which ...
3votes
2answers
266views
LeetCode 665: Non-decreasing Array (C)
I'm posting a solution for LeetCode's "Non-decreasing Array". If you'd like to review, please do. Thank you! Problem Given an array nums with ...
5votes
4answers
259views
String concatenation challange to be more efficient with DayOfWeek and Lists
I have this challange that I finished which asked to print out a string according to the provided schedule. Here is an example: ...
9votes
3answers
2kviews
LeetCode 1108: Defanging an IP Address
I'm posting two solutions for LeetCode's "Defanging an IP Address". If you'd like to review, please do. Thank you! Problem Given a valid (IPv4) IP address, return a defanged version of that ...
7votes
1answer
1kviews
Polynomial multiplication using Karatsuba method
I am trying to solve a problem, which requires me to output the xor of all coefficients in the product of 2 input polynomials. Having seen that the normal O(n^2) ...
3votes
1answer
280views
LeetCode 146: LRU Cache III
I'm posting my Java code for LeetCode's LRU Cache. If you have time and would like to review, please do so. Thank you! Problem Design and implement a data structure for Least Recently Used (LRU) cache....
1vote
1answer
251views
LeetCode 399: Evaluate Division
I'm posting my C++ code for LeetCode's Evaluate Division. If you have time and would like to review, please do so. Thank you! Problem Equations are given in the format A / B = k, where A and B are ...
1vote
1answer
888views
LeetCode 809: Expressive Words
I'm posting my C++ code for LeetCode's Expressive Words. If you have time and would like to review, please do so. Thank you! Sometimes people repeat letters to represent extra feeling, such as "...
2votes
0answers
810views
LeetCode 218: The Skyline Problem II
Here I'm posting my Java code for the skyline problem. If you have time and would like to review, please do so, I'd appreciate that. Problem A city's skyline is the outer contour of the silhouette ...
3votes
1answer
471views
LeetCode 767: Reorganize String
Here I'm posting my code for the Reorganize String problem on LeetCode. If you have time and would like to review, please do so, I'd appreciate that. On LeetCode, we are only allowed to change the ...
1vote
1answer
636views
LeetCode 76: Minimum Window Substring - Python
I'm posting a two-pointer, sliding-window problem of LeetCode (Minimum Window Substring) solved with Python. If you have time and would like to review the code, please do so, I appreciate that. On ...
1vote
1answer
323views
LeetCode 76: Minimum Window Substring
I'm posting an sliding window problem of LeetCode (Minimum Window Substring) with C++. If you have time and would like to review the code, please do so, I appreciate that. On LeetCode, we are only ...
0votes
1answer
176views
LeetCode 76: Minimum Window Substring - Java
I'm posting my Java code for the Minimum Window Substring. If you have time and would like to review, please do so, I appreciate that. Problem Given a string string...